import Vuex from 'vuex'
const store = new Vuex.Store({
	state: {
		userName: '未登录用户'
	},
	mutations: {
		MLOGIN(state, userName) {
			state.userName = userName
		},
		MLOGOUT(state) {
			state.userName = '退出登陆用户'
		}
	},
	actions: {
		login(context, userName) {
			context.commit('MLOGIN', userName)
		},
		logout(context) {
			context.commit('MLOGOUT')
		}
	}
})
export default store